import App from '@/view/App'
import permission from '@mixins/permission'
/**
 * 菜单管理
 */
export default {
  mixins: [permission],
  computed: {
    menu () {
      return App.menu.map(node => {
        return {
          icon: node.icon,
          name: node.name,
          nodes: node.nodes.filter(item => {
            return this.hasPermission(item.key)
          })
        }
      }).filter(node => {
        return node.nodes.length > 0
      })
    }
  }
}
